package com.cloudptt.wp.lock;

import android.app.ActivityManager;
import android.content.Context;
import android.telephony.TelephonyManager;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

public class Parser {
    public static final List<LockScreenActivity> KEY_GUARD_INSTANCES = new ArrayList<LockScreenActivity>();
    public static int sPhoneCallState = TelephonyManager.CALL_STATE_IDLE;

    /**
     * 用于杀掉锁屏
     */
    public static final void killBackgroundProcess(Context context) {
        if (context != null) {
            try {
                ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
                am.killBackgroundProcesses("com.huaqian");
                am.killBackgroundProcesses("com.huaqian:remote");
                am.killBackgroundProcesses("com.huaqian:bdservice_v1");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }


    public static final String getDataStr() {
        SimpleDateFormat format = new SimpleDateFormat("MM月dd日 EEE");
        String t=format.format(new Date());

//        Calendar c = Calendar.getInstance();
//        int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);
//        String weekStr = getWeekStr(c,dayOfWeek);

        return t ;
    }


//    private static String getWeekStr(Calendar c, int dayOfWeek)
//    {
//        if (c.get(Calendar.MONDAY) == dayOfWeek)
//            return "星期一";
//        else if (c.get(Calendar.TUESDAY) == dayOfWeek)
//            return "星期二";
//        else if (c.get(Calendar.WEDNESDAY) == dayOfWeek)
//            return "星期三";
//        else if (c.get(Calendar.THURSDAY) == dayOfWeek)
//            return "星期四";
//        else if (c.get(Calendar.FRIDAY) == dayOfWeek)
//            return "星期五";
//        else if (c.get(Calendar.SATURDAY) == dayOfWeek)
//            return "星期六";
//        else if (c.get(Calendar.SUNDAY) == dayOfWeek)
//            return "星期日";
//        return "星期日";
//    }
}
